package com.cn.serverline.lineicp.produce.controller;

import cn.stylefeng.roses.kernel.rule.pojo.response.ResponseData;
import cn.stylefeng.roses.kernel.rule.pojo.response.SuccessResponseData;
import com.cn.serverline.lineicp.produce.entity.vo.IpVo;
import com.cn.serverline.lineicp.produce.service.LoginIpService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.net.UnknownHostException;

/**
 * @Author 王烁烁
 * @Date 2024/8/6
 */
@RestController
@Api(tags = "登录ip")
@RequestMapping("/LoginIp")
public class LoginIpController {

    @Autowired
    private LoginIpService loginIpService;

    @ApiOperation("登录ip")
    @GetMapping("/getIp")
    public ResponseData<IpVo> getLoginIp() throws UnknownHostException {
        return new SuccessResponseData<>(loginIpService.getLoginIp());
    }

}
